/**
 * 
 */
package org.cuatrovientos.es;

import java.util.Random;

/**
 * clases de moneda
 * @author daniel_ancin
 *
 */
public class Moneda {
	
	/**
	 * flips a coin
	 * @return
	 */
	
	public String flip (){
		Random random =new Random();
		int result=0;
		String flipResult = "";
		
		//random number: 0 or 1
		result = random.nextInt(2);
		
		if (result==0){
			flipResult ="heads";
		}else{
			flipResult ="tails";
		}
		
		return flipResult;		
	}
	

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		Moneda myMoneda = new Moneda ();
		
		for (int i=0;i<100; i++){
				
		System . out.println(myMoneda.flip());
		}
	}

}
